//
//  UIImageView+SDWebcache.m
//  CBT
//
//  Created by 四点钟 on 2018/11/15.
//  Copyright © 2018 Mr.Zhang. All rights reserved.
//

#import "UIImageView+SDWebcache.h"
#import <SDWebImage/UIImageView+WebCache.h>

@implementation UIImageView(SDWebcache)

- (void)lf_setImageURL:(NSString *)url{
    self.contentMode = UIViewContentModeScaleAspectFit;
    self.backgroundColor = UIColorFromRGB(0xf0f0f0);
    
    [self sd_setImageWithURL:[NSURL URLWithString:url]
            placeholderImage:[UIImage imageNamed:@"image_placeholder"]
                     options:SDWebImageAllowInvalidSSLCertificates
                   completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
                       self.contentMode = UIViewContentModeScaleAspectFill;
                   }];
}

@end
